<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../print.css" type="text/css" media="print">
<meta content="Light3D,sandy.core.light.Light3D,MAX_POWER,changed,color,calculate,destroy,getDirectionPoint3D,getNormalizedPower,getPower,setDirection,setDirectionPoint3D,setPower" name="keywords">
<title>sandy.core.light.Light3D</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'Light3D - Sandy 3.1.2 API Documentation';
				var baseRef = '../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">Sandy 3D Engine, 3.1.2</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../index-list.html')" href="../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../index.html?sandy/core/light/Light3D.html&amp;sandy/core/light/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;Light3D</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a>&nbsp;| <a href="#eventSummary">Events</a>&nbsp;| <a href="#constantSummary">Constants</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class Light3D"); titleBar_setSubNav(true,true,false,false,true,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">sandy.core.light</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class Light3D</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">Light3D <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../../images/inherit-arrow.gif"> flash.events.EventDispatcher</td>
</tr>
</table>
<p></p>
  The Light3D class is used for creating the light of the world.
    <p>The light in Sandy is a light source at infinity, emitting parallel colored light.
  The direction, color, and intensity of the light can be changes.</p>
    <p></p>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#changed">changed</a> : Boolean<div class="summaryTableDescription">
   Public property which stores the modification of that light instance in case it changed.</div>
</td><td class="summaryTableOwnerCol">Light3D</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#color">color</a> : uint<div class="summaryTableDescription">
   The color of the light.</div>
</td><td class="summaryTableOwnerCol">Light3D</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#Light3D()">Light3D</a>(p_oD:<a href="../data/Point3D.html">Point3D</a>, p_nPow:Number)</div>
<div class="summaryTableDescription">
   Creates a new light source.</div>
</td><td class="summaryTableOwnerCol">Light3D</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#calculate()">calculate</a>(normal:<a href="../data/Point3D.html">Point3D</a>):Number</div>
<div class="summaryTableDescription">
   Calculates the strength of this light based on the supplied normal.</div>
</td><td class="summaryTableOwnerCol">Light3D</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#destroy()">destroy</a>():void</div>
<div class="summaryTableDescription">
   Not in use...</div>
</td><td class="summaryTableOwnerCol">Light3D</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getDirectionPoint3D()">getDirectionPoint3D</a>():<a href="../data/Point3D.html">Point3D</a>
</div>
<div class="summaryTableDescription">
   Returns the direction of the light.</div>
</td><td class="summaryTableOwnerCol">Light3D</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getNormalizedPower()">getNormalizedPower</a>():Number</div>
<div class="summaryTableDescription">
   Returns the power of the light normalized to the range 0 -> 1
      </div>
</td><td class="summaryTableOwnerCol">Light3D</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getPower()">getPower</a>():Number</div>
<div class="summaryTableDescription">
   Returns the intensity of the light.</div>
</td><td class="summaryTableOwnerCol">Light3D</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#setDirection()">setDirection</a>(x:Number, y:Number, z:Number):void</div>
<div class="summaryTableDescription">
   Uneeded? setDirectionPoint3D() does the same thing...</div>
</td><td class="summaryTableOwnerCol">Light3D</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#setDirectionPoint3D()">setDirectionPoint3D</a>(pDir:<a href="../data/Point3D.html">Point3D</a>):void</div>
<div class="summaryTableDescription">
   Sets the direction of the Light3D.</div>
</td><td class="summaryTableOwnerCol">Light3D</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#setPower()">setPower</a>(p_nPow:Number):void</div>
<div class="summaryTableDescription">
   The the power of the light.</div>
</td><td class="summaryTableOwnerCol">Light3D</td>
</tr>
</table>
</div>
<a name="eventSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Events</div>
<table id="summaryTableEvent" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Event</th><th>Summary</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#event:lightColorChanged">lightColorChanged</a>
</div>
</td><td class="summaryTableDescription summaryTableCol">
 Dispatched when the light color is changed.</td><td class="summaryTableOwnerCol">Light3D</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#event:lightUpdated">lightUpdated</a>
</div>
</td><td class="summaryTableDescription summaryTableCol">
 Dispatched when the light is updated.</td><td class="summaryTableOwnerCol">Light3D</td>
</tr>
</table>
</div>
<a name="constantSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Constants</div>
<table id="summaryTableConstant" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Constant</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#MAX_POWER">MAX_POWER</a> : Number = 150<div class="summaryTableDescription">[static]
  Maximum value accepted for the power of the light.</div>
</td><td class="summaryTableOwnerCol">Light3D</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="changed"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">changed</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>public var changed:Boolean</code><p>
   Public property which stores the modification of that light instance in case it changed.
   It is useful for the cache system
   </p></div>
<a name="color"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">color</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>color:uint</code>&nbsp;&nbsp;[read-write]<p>
   The color of the light.
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get color():uint</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set color(value:uint):void</code>
<br>
</div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="Light3D()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">Light3D</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function Light3D(p_oD:<a href="../data/Point3D.html">Point3D</a>, p_nPow:Number)</code><p>
   Creates a new light source.
      </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">p_oD</span>:<a href="../data/Point3D.html">Point3D</a></code> &mdash;  The direction of the emitted light.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">p_nPow</span>:Number</code> &mdash; The intensity of the emitted light.
         </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">
<a href="../data/Point3D.html" target="">sandy.core.data.Point3D</a>
</div>
</div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="calculate()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">calculate</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function calculate(normal:<a href="../data/Point3D.html">Point3D</a>):Number</code><p>
   Calculates the strength of this light based on the supplied normal.
      </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">normal</span>:<a href="../data/Point3D.html">Point3D</a></code></td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Number</code> &mdash; Number The strength between 0 and 1
         </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">
<a href="../data/Point3D.html" target="">sandy.core.data.Point3D</a>
</div>
</div>
<a name="destroy()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">destroy</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function destroy():void</code><p>
   Not in use...
   </p></div>
<a name="getDirectionPoint3D()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getDirectionPoint3D</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function getDirectionPoint3D():<a href="../data/Point3D.html">Point3D</a></code><p>
   Returns the direction of the light.
      </p><p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../data/Point3D.html">Point3D</a></code> &mdash; 
                         The light direction
         
                        
                     </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">
<a href="../data/Point3D.html" target="">sandy.core.data.Point3D</a>
</div>
</div>
<a name="getNormalizedPower()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getNormalizedPower</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function getNormalizedPower():Number</code><p>
   Returns the power of the light normalized to the range 0 -> 1
      </p><p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Number</code> &mdash; Number a number between 0 and 1
   </td>
</tr>
</table>
</div>
<a name="getPower()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getPower</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function getPower():Number</code><p>
   Returns the intensity of the light.
      </p><p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Number</code> &mdash; The intensity as a number between 0 - MAX_POWER.
   </td>
</tr>
</table>
</div>
<a name="setDirection()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">setDirection</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function setDirection(x:Number, y:Number, z:Number):void</code><p>
   Uneeded? setDirectionPoint3D() does the same thing...
      </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">x</span>:Number</code> &mdash; The x coordinate
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">y</span>:Number</code> &mdash; The y coordinate
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">z</span>:Number</code> &mdash; The z coordinate
   </td>
</tr>
</table>
</div>
<a name="setDirectionPoint3D()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">setDirectionPoint3D</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function setDirectionPoint3D(pDir:<a href="../data/Point3D.html">Point3D</a>):void</code><p>
   Sets the direction of the Light3D.
      </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">pDir</span>:<a href="../data/Point3D.html">Point3D</a></code> &mdash; A Point3D object representing the direction of the light.
         </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">
<a href="../data/Point3D.html" target="">sandy.core.data.Point3D</a>
</div>
</div>
<a name="setPower()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">setPower</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function setPower(p_nPow:Number):void</code><p>
   The the power of the light. A number between 0 and MAX_POWER is necessary.
   The highter the power of the light is, the less the shadows are visibles.
      </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">p_nPow</span>:Number</code> &mdash; Number a Number between 0 and MAX_POWER. This number is the light intensity.
   </td>
</tr>
</table>
</div>
<div class="detailSectionHeader">Event detail</div>
<a name="event:lightColorChanged"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">lightColorChanged</td><td class="detailHeaderType">event&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<span class="label">Event object type: </span><a href="../../events/SandyEvent.html"><code>sandy.events.SandyEvent</code></a>
<br>
<span class="label">SandyEvent.type property = </span><a href="../../events/SandyEvent.html#LIGHT_COLOR_CHANGED"><code>sandy.events.SandyEvent.LIGHT_COLOR_CHANGED</code></a>
<br><p>
 Dispatched when the light color is changed.
  </p><p>
   Defines the value of the <code>type</code> property of a <code>lightColorChanged</code> event object.
            </p></div>
<a name="event:lightUpdated"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">lightUpdated</td><td class="detailHeaderType">event&nbsp;</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<span class="label">Event object type: </span><a href="../../events/SandyEvent.html"><code>sandy.events.SandyEvent</code></a>
<br>
<span class="label">SandyEvent.type property = </span><a href="../../events/SandyEvent.html#LIGHT_UPDATED"><code>sandy.events.SandyEvent.LIGHT_UPDATED</code></a>
<br><p>
 Dispatched when the light is updated.
  </p><p>
   Defines the value of the <code>type</code> property of a <code>lightUpdated</code> event object.
            </p></div>
<a name="constantDetail"></a>
<div class="detailSectionHeader">Constant detail</div>
<a name="MAX_POWER"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">MAX_POWER</td><td class="detailHeaderType">constant</td>
</tr>
</table>
<div class="detailBody">
<code>public static const MAX_POWER:Number = 150</code><p>
  Maximum value accepted for the power of the light.
  Be aware that even if this constant is changed, the actual lighting calculations are normalized
  (<code>0</code> - <code>MAX_POWER</code> becomes <code>0</code> -> <code>1</code>).
  </p></div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright">API documentation for Sandy 3D Engine, Ver. 3.1.2</center>
</div>
</body>
</html>
<!--API documentation for Sandy 3D Engine, Ver. 3.1.2-->
